<?php

/**
 * This is the model class for table "sps_wm_profil_zusatz_sql".
 *
 * The followings are the available columns in table 'sps_wm_profil_zusatz_sql':
 * @property integer $Benutzernummer
 * @property string $Firma
 * @property string $Zusatz1
 * @property string $Zusatz2
 * @property string $Zusatz3
 * @property string $Postfach
 * @property string $Briefanrede
 * @property string $Email_Geschaeft
 * @property string $Fax_Privat
 * @property string $Fax_Geschaeft
 * @property integer $Adresse_geloescht
 * @property string $Letzte_Mutation
 * @property integer $Kundennummer
 * @property integer $Versionsnummer
 * @property integer $Kontaktnummer
 * @property string $Adressblock_Zeile_1
 * @property string $Adressblock_Zeile_2
 * @property string $Adressblock_Zeile_3
 * @property string $Adressblock_Zeile_4
 * @property string $Adressblock_Zeile_5
 * @property string $Adressblock_Zeile_6
 * @property string $Adressblock_Zeile_7
 * @property string $Adressblock_Zeile_8
 * @property string $Adressblock_Zeile_9
 * @property string $Adressblock_Zeile_10
 */
class MemberExtensions extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return MemberExtensions the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'sps_wm_profil_zusatz_sql';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('Benutzernummer, Adresse_geloescht, Kundennummer, Versionsnummer, Kontaktnummer', 'numerical', 'integerOnly'=>true),
			array('Firma, Zusatz1, Zusatz2, Zusatz3, Postfach, Adressblock_Zeile_1, Adressblock_Zeile_2, Adressblock_Zeile_3, Adressblock_Zeile_4, Adressblock_Zeile_5, Adressblock_Zeile_6, Adressblock_Zeile_7, Adressblock_Zeile_8, Adressblock_Zeile_9, Adressblock_Zeile_10', 'length', 'max'=>150),
			array('Briefanrede', 'length', 'max'=>100),
			array('Email_Geschaeft', 'length', 'max'=>50),
			array('Fax_Privat, Fax_Geschaeft', 'length', 'max'=>30),
			array('Letzte_Mutation', 'length', 'max'=>10),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('Benutzernummer, Firma, Zusatz1, Zusatz2, Zusatz3, Postfach, Briefanrede, Email_Geschaeft, Fax_Privat, Fax_Geschaeft, Adresse_geloescht, Letzte_Mutation, Kundennummer, Versionsnummer, Kontaktnummer, Adressblock_Zeile_1, Adressblock_Zeile_2, Adressblock_Zeile_3, Adressblock_Zeile_4, Adressblock_Zeile_5, Adressblock_Zeile_6, Adressblock_Zeile_7, Adressblock_Zeile_8, Adressblock_Zeile_9, Adressblock_Zeile_10', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'Benutzernummer' => 'Benutzernummer',
			'Firma' => 'Firma',
			'Zusatz1' => 'Zusatz1',
			'Zusatz2' => 'Zusatz2',
			'Zusatz3' => 'Zusatz3',
			'Postfach' => 'Postfach',
			'Briefanrede' => 'Briefanrede',
			'Email_Geschaeft' => 'Email Geschaeft',
			'Fax_Privat' => 'Fax Privat',
			'Fax_Geschaeft' => 'Fax Geschaeft',
			'Adresse_geloescht' => 'Adresse Geloescht',
			'Letzte_Mutation' => 'Letzte Mutation',
			'Kundennummer' => 'Kundennummer',
			'Versionsnummer' => 'Versionsnummer',
			'Kontaktnummer' => 'Kontaktnummer',
			'Adressblock_Zeile_1' => 'Adressblock Zeile 1',
			'Adressblock_Zeile_2' => 'Adressblock Zeile 2',
			'Adressblock_Zeile_3' => 'Adressblock Zeile 3',
			'Adressblock_Zeile_4' => 'Adressblock Zeile 4',
			'Adressblock_Zeile_5' => 'Adressblock Zeile 5',
			'Adressblock_Zeile_6' => 'Adressblock Zeile 6',
			'Adressblock_Zeile_7' => 'Adressblock Zeile 7',
			'Adressblock_Zeile_8' => 'Adressblock Zeile 8',
			'Adressblock_Zeile_9' => 'Adressblock Zeile 9',
			'Adressblock_Zeile_10' => 'Adressblock Zeile 10',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('Benutzernummer',$this->Benutzernummer);
		$criteria->compare('Firma',$this->Firma,true);
		$criteria->compare('Zusatz1',$this->Zusatz1,true);
		$criteria->compare('Zusatz2',$this->Zusatz2,true);
		$criteria->compare('Zusatz3',$this->Zusatz3,true);
		$criteria->compare('Postfach',$this->Postfach,true);
		$criteria->compare('Briefanrede',$this->Briefanrede,true);
		$criteria->compare('Email_Geschaeft',$this->Email_Geschaeft,true);
		$criteria->compare('Fax_Privat',$this->Fax_Privat,true);
		$criteria->compare('Fax_Geschaeft',$this->Fax_Geschaeft,true);
		$criteria->compare('Adresse_geloescht',$this->Adresse_geloescht);
		$criteria->compare('Letzte_Mutation',$this->Letzte_Mutation,true);
		$criteria->compare('Kundennummer',$this->Kundennummer);
		$criteria->compare('Versionsnummer',$this->Versionsnummer);
		$criteria->compare('Kontaktnummer',$this->Kontaktnummer);
		$criteria->compare('Adressblock_Zeile_1',$this->Adressblock_Zeile_1,true);
		$criteria->compare('Adressblock_Zeile_2',$this->Adressblock_Zeile_2,true);
		$criteria->compare('Adressblock_Zeile_3',$this->Adressblock_Zeile_3,true);
		$criteria->compare('Adressblock_Zeile_4',$this->Adressblock_Zeile_4,true);
		$criteria->compare('Adressblock_Zeile_5',$this->Adressblock_Zeile_5,true);
		$criteria->compare('Adressblock_Zeile_6',$this->Adressblock_Zeile_6,true);
		$criteria->compare('Adressblock_Zeile_7',$this->Adressblock_Zeile_7,true);
		$criteria->compare('Adressblock_Zeile_8',$this->Adressblock_Zeile_8,true);
		$criteria->compare('Adressblock_Zeile_9',$this->Adressblock_Zeile_9,true);
		$criteria->compare('Adressblock_Zeile_10',$this->Adressblock_Zeile_10,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}